/**
 * @Author YuanYuan
 * @Date 2022/9/15
 * @Time 20:33
 */
public class SingletonLazy {
    private volatile static SingletonLazy instance = null;

    public static  SingletonLazy getInstance() {
        if(instance == null) {
            synchronized (SingletonLazy.class) {
                if (instance == null) {
                    instance = new SingletonLazy();
                }
            }
        }


        return instance;
    }

    private SingletonLazy() {
    }

    public static void main(String[] args) {
        SingletonLazy singletonLazy = getInstance();
    }
}
